<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 1需要两个文件，一个css 一个js -->
		<link rel="stylesheet" href="https://unpkg.com/swiper@8/swiper-bundle.min.css">
		<script src="https://unpkg.com/swiper@8/swiper-bundle.min.js"> </script>
		<style>
			/* 3添加一个大小 */
			.swiper {
			    width: 600px;
			    height: 300px;
			}
			.swiper img{
				width: 100%;height: 100%;
			}
		</style>
	</head>
	<body>
		<!-- 2添加html -->
		<div class="swiper">
		    <div class="swiper-wrapper">
		        <div class="swiper-slide">
					<img src="image/01.jpeg" alt="">
				</div>
		        <div class="swiper-slide">
					<img src="image/01.jpeg" alt="">
				</div>
		        <div class="swiper-slide">
					<img src="image/01.jpeg" alt="">
				</div>
		    </div>
		    <!-- 如果需要分页器 -->
		    <div class="swiper-pagination"></div>
		    
		    <!-- 如果需要导航按钮 -->
		    <div class="swiper-button-prev"></div>
		    <div class="swiper-button-next"></div>
		    
		    <!-- 如果需要滚动条 -->
		    <div class="swiper-scrollbar"></div>
		</div>
		
	</body>
	<script>     
		//4初始化轮播图
	  var mySwiper = new Swiper ('.swiper', {
	    direction: 'horizontal', // 垂直切换选项
	    loop: false, // 循环模式选项
	    autoplay: {
	       delay: 1000,
	       stopOnLastSlide: false,
	       disableOnInteraction: true,
	       },//自动播放
	    // 如果需要分页器
	    pagination: {
	      el: '.swiper-pagination',
	    },
	    
	    // 如果需要前进后退按钮
	    navigation: {
	      nextEl: '.swiper-button-next',
	      prevEl: '.swiper-button-prev',
	    },
	    
	    // 如果需要滚动条
	    scrollbar: {
	      el: '.swiper-scrollbar',
	    },
		effect:"cube",
		mousewheel: true,
	  })        
	  </script>
</html>